package com.neusoft.neu24.nep.controller;

import com.neusoft.neu24.nep.entity.CommonResult;
import com.neusoft.neu24.nep.service.ISysnodeService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sysnode")
public class SysnodeController {

    @Resource
    Environment environment;

    @Autowired
    ISysnodeService  sysnodeService;

    @RequestMapping("/q/by/{roleid}")
    public CommonResult selectSysnodesByRoleId( @PathVariable("roleid") int roleid)
    {
        System.out.println(environment.getProperty("server.port"));
        return sysnodeService.selectByRoleId(roleid);
    }
}
